import React from 'react'
import styles from './index.module.less'
import { resumeTypeMap, workTimeTypeMap } from '@/const'
import { formateMoney } from '@/utils'

export default function Job({ dataSource }: any) {
    const chineseNo = ['一', '二', '三', '四', '五', '六', '七', '八', '九', '十']
    const { userBarrier } = dataSource
    const { detail } = userBarrier
    return (
        <div className={styles.container}>
            {detail?.map((item: any, idx: number) => {
                return (
                    <div className={styles.box_wrapper} key={item}>
                        <div className={styles.title}>意向岗位{chineseNo[idx]}</div>
                        <div className={styles.box}>
                            <div className={styles.item}>
                                <span className={styles.label}>求职类型：</span>
                                <span>{resumeTypeMap.get(Number(item?.type))}</span>
                            </div>
                            <div className={styles.item}>
                                <span className={styles.label}>期望行业：</span>
                                <span>{item.industryName}</span>
                            </div>
                            <div className={styles.item}>
                                <span className={styles.label}>期望城市：</span>
                                <span>{item?.cityName}</span>
                            </div>
                            <div className={styles.item}>
                                <span className={styles.label}>岗位意向：</span>
                                <span>{item?.capacityName}</span>
                            </div>
                            {Number(item.type) !== 2 && (
                                <div className={styles.item}>
                                    <span className={styles.label}>薪资范围（税前）：</span>
                                    <span>
                                        {formateMoney(item?.minSalary)} ~ {formateMoney(item?.maxSalary)}
                                    </span>
                                </div>
                            )}
                            <div className={styles.item}>
                                <span className={styles.label}>工作区域：</span>
                                <span>
                                    {item?.workAreaName}
                                    {item?.workAreaName && item?.detailedWorkArea ? '，' : ''}
                                    {item?.detailedWorkArea}
                                    {item?.workAreaName || item?.detailedWorkArea ? '' : '暂无'}
                                </span>
                            </div>
                            <div className={styles.item}>
                                <span className={styles.label}>工作班时：</span>
                                <span>{workTimeTypeMap.get(Number(item?.workTime)) || '暂无'}</span>
                            </div>
                            <div className={styles.item}>
                                <span className={styles.label}>其他偏好：</span>
                                <span>{item?.otherPreference || '暂无'}</span>
                            </div>
                        </div>
                    </div>
                )
            })}
        </div>
    )
}
